<?php

//UMA new
use Illuminate\Database\Seeder;
use App\Models\Company;
use App\Models\CustomerHistory;
use App\Models\ContactInfo;

class CompanySeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $companies = [
            [
                'company_name' => 'インサイトスコア',
                'company_id' => 'insite',
                //'api_authentication_key' => 't2*a+gBQkzH+76q6E6AJMMNJn8HZsk,EUYg_6Q93',
                'status' => 1,
            ],
            [
                'company_name' => 'iYell',
                'company_id' => 'iYell',
                //'api_authentication_key' => 'Buk/EC/5C,AVhY,+hrB&U,5-(E*.X!*8MDZWwqhn',
                'status' => 1,
            ],
        ];

        foreach ($companies as $v) {
            $company = Company::updateOrCreate(['company_id' => $v['company_id']], $v);
            //create test data in database
            //$history = $company->customer_histories()->save(factory(CustomerHistory::class)->make());
            //$history->contact()->save(factory(ContactInfo::class)->make());
        }
    }
}
